{smcl}
{right:version 1.1}
{title:Title}

{phang}
{cmd:xlstocsv} {hline 2} Convert xls/xlsx to csv
 

{title:Syntax}

{p 8 16 2}
{cmd: xlstocsv} {p_end}

{p 8 16 2}
{cmd: xlstocsv} {it:pathtoxlsx[pathtoxls]} {cmd:,}  [{it:todir(pathforcsv) first}] {p_end}

{p 8 16 2}
{cmd: xlstocsv} {it:directory} {cmd:,}  [{it:todir(pathforcsv) first}] {p_end}



{title:Options}

{p 4 4 2}

{synoptset 20 tabbed}{...}
{synopthdr}
{synoptline}

{synopt:{opt todir(pathforcsv)}}specifies the directory to store the csv files in your PC; if missing, 
a CSV folder is generated in the parent path of path{p_end} 


{synopt:{opt first}}specifies only exporting the first sheet in the workbook{p_end} 


{title:Example(s)}

{p 4 4 2}

{p 4 4 2}
Converting all xls/xlsx files in the specified directory; csv files are stored in C:\tmp\CSV.

    . xlstocsv C:\tmp

{p 4 4 2}
Converting a xls/xlsx file in the local directory.

    . xlstocsv C:\tmp\test.xls, todir(C:\tmp\csv)

{p 4 4 2}
Using Dialog-box mode

	. xlstocsv


{title:Author}

{p 4 4 2}
Kerry Du     {break}
Xiamen University      {break}
Email:kerrydu@xmu.edu.cn     {break}
